package com.example.swaggerdemo.controller;

import com.example.swaggerdemo.entity.Student;

import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

/**
 * @author 杨光
 * @date 2022年02月10日 13:26
 */

@Api(tags = "操作学生信息的功能")
@RestController
public class StudentController {

    @GetMapping("student/query")
    @ApiOperation(value = "查询学生",notes ="查询学生信息的方法" )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sname",dataType = "String",paramType="query",value="学生姓名"),
            @ApiImplicitParam(name = "code",dataType = "String",paramType="query",value="学生学号")
    })
    public Student query(String sname,String code){
        Student student = new Student();
        student.setAge(11);
        student.setCode("122222");
        student.setSname("zhangsan");
        return student;
    }

    @PostMapping("student/add")
    @ApiOperation(value = "添加学生",notes ="添加学生信息的方法")
//    @ApiImplicitParam(name = "student", value = "学生信息对象", required = true, dataType = "Student")
    public void add(@RequestBody @ApiParam("徐盛") Student student){

        return ;
    }
}
